<?php
$actid= 9;
$openid= "oqi8iuH5c4b4GNOFz0K71NdrSCx0";
$host = "wechat.ka.social-touch.com:30399";
for($i=0; $i< 10000000 ;$i++){
    $begin = microtime(true);
    $url = "http://$host/wapJiuding/draw?actid=$actid&openid=$openid";
    $str = file_get_contents($url);
    $arr = json_decode($str, true);
    if($arr['code'] == 200 && ($arr['msg'] == 2 || $arr['msg'] ==1)){
        file_put_contents("haha.kk", "\n". $arr['prizeId'], FILE_APPEND);
        echo "\ngood:".$arr['prizeId'];exit;
    }else{        
        file_get_contents("http://$host/wapJiuding/deleteByOpenid?actid=$actid&openid=$openid");
    }
    $end = microtime(true);
    echo "\ntime:".round($end - $begin, 3);
}

